import axios from "./index"

const http = {
    get: (url: string) => {
        axios.get(url)
    },
    post: async (url: string, params: Object) => {
        return await axios.post(url, params)
    },
    put: (url: string, params: Object) => {
        axios.put(url, params)
    },
    delete: (url: string, params: Object) => {
        axios.delete(url, params)
    },
    upload: (url: string, file: Object) => {
        axios.post(url, file, {
            headers: {'Content-Type': 'multipart/form-data'}
        })
    },
}

export default http